package com.lyubia.shop.portal.controller;

import com.lyubia.shop.api.pojo.GoodsCategory;
import com.lyubia.shop.api.service.GoodsCategoryService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("goodsCategory")
public class GoodsCategoryController {

    @Reference(version = "1.0")
    private GoodsCategoryService goodsCategoryService;

    @GetMapping("/list")
    @ResponseBody
    public List<GoodsCategory> query() {
        return goodsCategoryService.selectCategoryAndChild();
    }

}
